{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## Load data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-28T19:15:31.810760Z",
     "start_time": "2020-08-28T19:15:28.660454Z"
    },
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1550</th>\n",
       "      <th>feature_1551</th>\n",
       "      <th>feature_1552</th>\n",
       "      <th>feature_1553</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>160</td>\n",
       "      <td>1.6000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20</td>\n",
       "      <td>83</td>\n",
       "      <td>4.1500</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>99</td>\n",
       "      <td>150</td>\n",
       "      <td>1.5151</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>40</td>\n",
       "      <td>40</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>234</td>\n",
       "      <td>19.5000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1758</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1759</th>\n",
       "      <td>40</td>\n",
       "      <td>200</td>\n",
       "      <td>5.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1760</th>\n",
       "      <td>96</td>\n",
       "      <td>218</td>\n",
       "      <td>2.2708</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1761</th>\n",
       "      <td>16</td>\n",
       "      <td>81</td>\n",
       "      <td>5.0625</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1762</th>\n",
       "      <td>36</td>\n",
       "      <td>41</td>\n",
       "      <td>1.1388</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1763 rows × 1559 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0           100        160     1.6000          0          0          0   \n",
       "1            20         83     4.1500          1          0          0   \n",
       "2            99        150     1.5151          1          0          0   \n",
       "3            40         40     1.0000          0          0          0   \n",
       "4            12        234    19.5000          1          0          0   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "1758          1          1     2.0000          1          0          0   \n",
       "1759         40        200     5.0000          1          0          0   \n",
       "1760         96        218     2.2708          1          0          0   \n",
       "1761         16         81     5.0625          1          0          0   \n",
       "1762         36         41     1.1388          0          0          0   \n",
       "\n",
       "      feature_7  feature_8  feature_9  feature_10  ...  feature_1550  \\\n",
       "0             0          0          0           0  ...             0   \n",
       "1             0          0          0           1  ...             0   \n",
       "2             0          0          0           0  ...             0   \n",
       "3             0          0          0           0  ...             0   \n",
       "4             0          0          0           0  ...             0   \n",
       "...         ...        ...        ...         ...  ...           ...   \n",
       "1758          0          0          0           0  ...             0   \n",
       "1759          0          0          0           0  ...             0   \n",
       "1760          0          0          0           0  ...             0   \n",
       "1761          1          0          0           0  ...             0   \n",
       "1762          0          0          0           0  ...             0   \n",
       "\n",
       "      feature_1551  feature_1552  feature_1553  feature_1554  feature_1555  \\\n",
       "0                0             0             0             0             0   \n",
       "1                0             0             0             0             1   \n",
       "2                0             0             0             0             0   \n",
       "3                0             0             0             0             0   \n",
       "4                0             0             0             0             0   \n",
       "...            ...           ...           ...           ...           ...   \n",
       "1758             0             0             0             0             0   \n",
       "1759             0             0             0             0             0   \n",
       "1760             0             0             0             0             0   \n",
       "1761             0             0             0             0             0   \n",
       "1762             0             0             0             0             0   \n",
       "\n",
       "      feature_1556  feature_1557  feature_1558  Class  \n",
       "0                0             0             0      0  \n",
       "1                0             0             0      0  \n",
       "2                0             0             0      0  \n",
       "3                0             0             0      0  \n",
       "4                0             0             0      0  \n",
       "...            ...           ...           ...    ...  \n",
       "1758             0             0             0      0  \n",
       "1759             0             0             0      0  \n",
       "1760             0             0             0      0  \n",
       "1761             0             0             0      0  \n",
       "1762             0             0             0      0  \n",
       "\n",
       "[1763 rows x 1559 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1549</th>\n",
       "      <th>feature_1550</th>\n",
       "      <th>feature_1551</th>\n",
       "      <th>feature_1552</th>\n",
       "      <th>feature_1553</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>60.0</td>\n",
       "      <td>468.0</td>\n",
       "      <td>7.8000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>108.0</td>\n",
       "      <td>179.0</td>\n",
       "      <td>1.6574</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>60.0</td>\n",
       "      <td>468.0</td>\n",
       "      <td>7.8000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>60.0</td>\n",
       "      <td>120.0</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>751</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>752</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>753</th>\n",
       "      <td>12.0</td>\n",
       "      <td>101.0</td>\n",
       "      <td>8.4166</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>754</th>\n",
       "      <td>31.0</td>\n",
       "      <td>88.0</td>\n",
       "      <td>2.8387</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>755</th>\n",
       "      <td>49.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>1.7755</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>756 rows × 1558 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0         60.0      468.0     7.8000        1.0          0          0   \n",
       "1        108.0      179.0     1.6574        1.0          0          0   \n",
       "2          1.0        1.0     2.0000        0.0          0          0   \n",
       "3         60.0      468.0     7.8000        1.0          0          0   \n",
       "4         60.0      120.0     2.0000        1.0          0          0   \n",
       "..         ...        ...        ...        ...        ...        ...   \n",
       "751        1.0        1.0     2.0000        0.0          0          0   \n",
       "752        1.0        1.0     2.0000        0.0          0          0   \n",
       "753       12.0      101.0     8.4166        1.0          0          0   \n",
       "754       31.0       88.0     2.8387        1.0          0          0   \n",
       "755       49.0       87.0     1.7755        0.0          0          0   \n",
       "\n",
       "     feature_7  feature_8  feature_9  feature_10  ...  feature_1549  \\\n",
       "0            0          0          0           0  ...             0   \n",
       "1            0          0          0           0  ...             0   \n",
       "2            0          0          0           0  ...             0   \n",
       "3            0          0          0           0  ...             0   \n",
       "4            0          0          0           0  ...             0   \n",
       "..         ...        ...        ...         ...  ...           ...   \n",
       "751          0          0          0           0  ...             0   \n",
       "752          0          0          0           0  ...             0   \n",
       "753          0          0          0           0  ...             0   \n",
       "754          0          0          0           0  ...             0   \n",
       "755          0          0          0           0  ...             0   \n",
       "\n",
       "     feature_1550  feature_1551  feature_1552  feature_1553  feature_1554  \\\n",
       "0               0             0             0             0             0   \n",
       "1               0             0             0             0             0   \n",
       "2               0             0             0             0             0   \n",
       "3               0             0             0             0             0   \n",
       "4               0             0             0             0             0   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "751             0             0             0             0             0   \n",
       "752             0             0             0             0             0   \n",
       "753             0             0             0             0             0   \n",
       "754             0             0             0             0             0   \n",
       "755             0             0             0             0             0   \n",
       "\n",
       "     feature_1555  feature_1556  feature_1557  feature_1558  \n",
       "0               0             0             0             0  \n",
       "1               0             0             0             0  \n",
       "2               0             0             0             0  \n",
       "3               0             0             0             0  \n",
       "4               0             0             0             0  \n",
       "..            ...           ...           ...           ...  \n",
       "751             0             0             0             0  \n",
       "752             0             0             0             0  \n",
       "753             0             0             0             0  \n",
       "754             0             0             0             0  \n",
       "755             0             0             0             0  \n",
       "\n",
       "[756 rows x 1558 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import os\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "%matplotlib inline\n",
    "import matplotlib as plt\n",
    "import seaborn as sns\n",
    "\n",
    "train = pd.read_csv('./data/Train.csv')\n",
    "display(train)\n",
    "\n",
    "test = pd.read_csv('./data/Test.csv')\n",
    "display(test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## Explore data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-28T19:17:04.183899Z",
     "start_time": "2020-08-28T19:17:04.177934Z"
    },
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1620\n",
       "1     143\n",
       "Name: Class, dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train['Class'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-29T17:21:20.047934Z",
     "start_time": "2020-08-29T17:21:16.657337Z"
    },
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1550</th>\n",
       "      <th>feature_1551</th>\n",
       "      <th>feature_1552</th>\n",
       "      <th>feature_1553</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1698</th>\n",
       "      <td>328</td>\n",
       "      <td>120</td>\n",
       "      <td>0.3658</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1699</th>\n",
       "      <td>351</td>\n",
       "      <td>494</td>\n",
       "      <td>1.4074</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1700</th>\n",
       "      <td>359</td>\n",
       "      <td>243</td>\n",
       "      <td>0.6768</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1701</th>\n",
       "      <td>480</td>\n",
       "      <td>640</td>\n",
       "      <td>1.3333</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1702</th>\n",
       "      <td>640</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0015</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1703 rows × 1559 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0             1          1     1.0000          1          0          0   \n",
       "1             1          1     2.0000          0          0          0   \n",
       "2             1          1     2.0000          0          0          0   \n",
       "3             1          1     2.0000          0          0          0   \n",
       "4             1          1     2.0000          0          0          0   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "1698        328        120     0.3658          1          0          0   \n",
       "1699        351        494     1.4074          0          0          0   \n",
       "1700        359        243     0.6768          1          0          0   \n",
       "1701        480        640     1.3333          1          0          0   \n",
       "1702        640          1     0.0015          1          0          0   \n",
       "\n",
       "      feature_7  feature_8  feature_9  feature_10  ...  feature_1550  \\\n",
       "0             0          0          0           0  ...             0   \n",
       "1             0          0          0           0  ...             0   \n",
       "2             0          0          0           0  ...             0   \n",
       "3             0          0          0           0  ...             0   \n",
       "4             0          0          0           0  ...             0   \n",
       "...         ...        ...        ...         ...  ...           ...   \n",
       "1698          0          0          0           0  ...             0   \n",
       "1699          0          0          0           0  ...             0   \n",
       "1700          0          0          0           0  ...             0   \n",
       "1701          0          0          0           0  ...             0   \n",
       "1702          0          0          0           0  ...             0   \n",
       "\n",
       "      feature_1551  feature_1552  feature_1553  feature_1554  feature_1555  \\\n",
       "0                0             0             0             0             0   \n",
       "1                0             0             0             0             0   \n",
       "2                0             0             0             0             0   \n",
       "3                0             0             0             0             1   \n",
       "4                0             0             0             0             0   \n",
       "...            ...           ...           ...           ...           ...   \n",
       "1698             0             0             0             0             0   \n",
       "1699             0             0             0             0             0   \n",
       "1700             0             0             0             0             0   \n",
       "1701             0             0             0             0             0   \n",
       "1702             0             0             0             0             0   \n",
       "\n",
       "      feature_1556  feature_1557  feature_1558  Class  \n",
       "0                0             0             0      0  \n",
       "1                0             0             0      0  \n",
       "2                0             0             0      0  \n",
       "3                1             1             0      0  \n",
       "4                0             0             0      0  \n",
       "...            ...           ...           ...    ...  \n",
       "1698             0             0             0      0  \n",
       "1699             0             0             0      0  \n",
       "1700             0             0             0      0  \n",
       "1701             0             0             0      0  \n",
       "1702             0             0             0      0  \n",
       "\n",
       "[1703 rows x 1559 columns]"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def allbut(*names):\n",
    "    names = set(names)\n",
    "    return [item for item in train.columns if item not in names]\n",
    "\n",
    "train_dedup = train.groupby(allbut('Class'))['Class'].sum().reset_index(name='Class')\n",
    "\n",
    "train_dedup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-29T14:13:07.279314Z",
     "start_time": "2020-08-29T14:13:07.272774Z"
    },
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "feature_1         int64\n",
       "feature_2         int64\n",
       "feature_3       float64\n",
       "feature_4         int64\n",
       "feature_5         int64\n",
       "                 ...   \n",
       "feature_1555      int64\n",
       "feature_1556      int64\n",
       "feature_1557      int64\n",
       "feature_1558      int64\n",
       "Class             int64\n",
       "Length: 1559, dtype: object"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Submission: Submission 04 -- Identify training data points in test data & override probabilities"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Identify test data points that are present in the training data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-01T20:02:47.529354Z",
     "start_time": "2020-09-01T20:02:41.970257Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1763, 1559) (756, 1558)\n",
      "(756, 1559)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "3      0.0\n",
       "4      1.0\n",
       "29     0.0\n",
       "43     0.0\n",
       "68     0.0\n",
       "77     0.0\n",
       "88     0.0\n",
       "106    1.0\n",
       "138    0.0\n",
       "199    0.0\n",
       "315    1.0\n",
       "323    1.0\n",
       "359    0.0\n",
       "363    1.0\n",
       "370    0.0\n",
       "376    0.0\n",
       "398    0.0\n",
       "442    0.0\n",
       "451    0.0\n",
       "476    0.0\n",
       "479    0.0\n",
       "482    0.0\n",
       "489    1.0\n",
       "518    0.0\n",
       "520    0.0\n",
       "544    0.0\n",
       "599    1.0\n",
       "602    0.0\n",
       "604    0.0\n",
       "622    0.0\n",
       "636    0.0\n",
       "651    0.0\n",
       "658    1.0\n",
       "691    0.0\n",
       "Name: Class, dtype: float64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a = train\n",
    "b = test\n",
    "\n",
    "print(a.shape, b.shape)\n",
    "\n",
    "c = pd.merge(b, a, how='left')\n",
    "\n",
    "print(c.shape)\n",
    "display(c[c['Class'].isna()==False]['Class'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-01T20:05:35.343599Z",
     "start_time": "2020-09-01T20:05:35.334775Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[3,\n",
       " 4,\n",
       " 29,\n",
       " 43,\n",
       " 68,\n",
       " 77,\n",
       " 88,\n",
       " 106,\n",
       " 138,\n",
       " 199,\n",
       " 315,\n",
       " 323,\n",
       " 359,\n",
       " 363,\n",
       " 370,\n",
       " 376,\n",
       " 398,\n",
       " 442,\n",
       " 451,\n",
       " 476,\n",
       " 479,\n",
       " 482,\n",
       " 489,\n",
       " 518,\n",
       " 520,\n",
       " 544,\n",
       " 599,\n",
       " 602,\n",
       " 604,\n",
       " 622,\n",
       " 636,\n",
       " 651,\n",
       " 658,\n",
       " 691]"
      ]
     },
     "execution_count": 168,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c[c['Class'].isna()==False].index.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-01T20:09:23.552376Z",
     "start_time": "2020-09-01T20:09:23.530378Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.380396</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.005744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.194091</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.631173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.423787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>751</th>\n",
       "      <td>0.011839</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>752</th>\n",
       "      <td>0.006260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>753</th>\n",
       "      <td>0.004772</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>754</th>\n",
       "      <td>0.007036</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>755</th>\n",
       "      <td>0.007106</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>756 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Class\n",
       "0    0.380396\n",
       "1    0.005744\n",
       "2    0.194091\n",
       "3    0.631173\n",
       "4    0.423787\n",
       "..        ...\n",
       "751  0.011839\n",
       "752  0.006260\n",
       "753  0.004772\n",
       "754  0.007036\n",
       "755  0.007106\n",
       "\n",
       "[756 rows x 1 columns]"
      ]
     },
     "execution_count": 177,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_01 = pd.read_csv('./submissions/submission_01.csv')\n",
    "\n",
    "sub_04 = sub_01.copy()\n",
    "\n",
    "for idx in c[c['Class'].isna()==False].index.tolist():\n",
    "    #print(idx, sub_04.iloc[idx,0])\n",
    "    if sub_04.iloc[idx,0] < 0.1:\n",
    "        sub_04.iloc[idx,0] = 0.0\n",
    "\n",
    "sub_04"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sub_04.to_csv('./submissions/submission_04.csv', index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Submission: MH18 Output 03 -- Data Preparation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-29T17:35:58.889514Z",
     "start_time": "2020-08-29T17:35:58.868513Z"
    }
   },
   "outputs": [],
   "source": [
    "X = train_dedup.drop(['Class'], axis=1)\n",
    "\n",
    "y = train_dedup['Class']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Extract outlier indicators as features - LOF, ISOF, KNN, OCSVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:04:41.988326Z",
     "start_time": "2020-08-30T13:04:41.807714Z"
    }
   },
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import MinMaxScaler\n",
    "\n",
    "scaler = MinMaxScaler()\n",
    "\n",
    "X2 = train.drop(['Class'], axis=1)\n",
    "\n",
    "scaler.fit(X2)\n",
    "\n",
    "X2 = pd.DataFrame(scaler.transform(X2), columns=X2.columns)\n",
    "\n",
    "train2 = X2.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:04:44.346624Z",
     "start_time": "2020-08-30T13:04:44.314273Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1549</th>\n",
       "      <th>feature_1550</th>\n",
       "      <th>feature_1551</th>\n",
       "      <th>feature_1552</th>\n",
       "      <th>feature_1553</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.154930</td>\n",
       "      <td>0.248826</td>\n",
       "      <td>0.026642</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.029734</td>\n",
       "      <td>0.128326</td>\n",
       "      <td>0.069143</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.153365</td>\n",
       "      <td>0.233177</td>\n",
       "      <td>0.025227</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.016642</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.017214</td>\n",
       "      <td>0.364632</td>\n",
       "      <td>0.324983</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1758</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1759</th>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.311424</td>\n",
       "      <td>0.083310</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1760</th>\n",
       "      <td>0.148670</td>\n",
       "      <td>0.339593</td>\n",
       "      <td>0.037823</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1761</th>\n",
       "      <td>0.023474</td>\n",
       "      <td>0.125196</td>\n",
       "      <td>0.084352</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1762</th>\n",
       "      <td>0.054773</td>\n",
       "      <td>0.062598</td>\n",
       "      <td>0.018955</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1763 rows × 1558 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0      0.154930   0.248826   0.026642        0.0        0.0        0.0   \n",
       "1      0.029734   0.128326   0.069143        1.0        0.0        0.0   \n",
       "2      0.153365   0.233177   0.025227        1.0        0.0        0.0   \n",
       "3      0.061033   0.061033   0.016642        0.0        0.0        0.0   \n",
       "4      0.017214   0.364632   0.324983        1.0        0.0        0.0   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "1758   0.000000   0.000000   0.033309        1.0        0.0        0.0   \n",
       "1759   0.061033   0.311424   0.083310        1.0        0.0        0.0   \n",
       "1760   0.148670   0.339593   0.037823        1.0        0.0        0.0   \n",
       "1761   0.023474   0.125196   0.084352        1.0        0.0        0.0   \n",
       "1762   0.054773   0.062598   0.018955        0.0        0.0        0.0   \n",
       "\n",
       "      feature_7  feature_8  feature_9  feature_10  ...  feature_1549  \\\n",
       "0           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1           0.0        0.0        0.0         1.0  ...           0.0   \n",
       "2           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "3           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "4           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "...         ...        ...        ...         ...  ...           ...   \n",
       "1758        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1759        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1760        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1761        1.0        0.0        0.0         0.0  ...           0.0   \n",
       "1762        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "\n",
       "      feature_1550  feature_1551  feature_1552  feature_1553  feature_1554  \\\n",
       "0              0.0           0.0           0.0           0.0           0.0   \n",
       "1              0.0           0.0           0.0           0.0           0.0   \n",
       "2              0.0           0.0           0.0           0.0           0.0   \n",
       "3              0.0           0.0           0.0           0.0           0.0   \n",
       "4              0.0           0.0           0.0           0.0           0.0   \n",
       "...            ...           ...           ...           ...           ...   \n",
       "1758           0.0           0.0           0.0           0.0           0.0   \n",
       "1759           0.0           0.0           0.0           0.0           0.0   \n",
       "1760           0.0           0.0           0.0           0.0           0.0   \n",
       "1761           0.0           0.0           0.0           0.0           0.0   \n",
       "1762           0.0           0.0           0.0           0.0           0.0   \n",
       "\n",
       "      feature_1555  feature_1556  feature_1557  feature_1558  \n",
       "0              0.0           0.0           0.0           0.0  \n",
       "1              1.0           0.0           0.0           0.0  \n",
       "2              0.0           0.0           0.0           0.0  \n",
       "3              0.0           0.0           0.0           0.0  \n",
       "4              0.0           0.0           0.0           0.0  \n",
       "...            ...           ...           ...           ...  \n",
       "1758           0.0           0.0           0.0           0.0  \n",
       "1759           0.0           0.0           0.0           0.0  \n",
       "1760           0.0           0.0           0.0           0.0  \n",
       "1761           0.0           0.0           0.0           0.0  \n",
       "1762           0.0           0.0           0.0           0.0  \n",
       "\n",
       "[1763 rows x 1558 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(train2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:04:56.058511Z",
     "start_time": "2020-08-30T13:04:56.049493Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2.05756764 4.06221455 2.06975877 ... 1.91355543 2.20223306 1.31986576]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.neighbors import LocalOutlierFactor\n",
    "\n",
    "lof = LocalOutlierFactor(n_neighbors=50, contamination='auto')\n",
    "\n",
    "lof.fit_predict(X2)\n",
    "\n",
    "lof_scores = -lof.negative_outlier_factor_\n",
    "print(lof_scores)\n",
    "\n",
    "train2['LOF'] = lof_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:07:59.134064Z",
     "start_time": "2020-08-30T13:07:14.237173Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.30713826 0.34209496 0.30588404 ... 0.30382299 0.31328194 0.33103354]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import IsolationForest\n",
    "\n",
    "isof = IsolationForest(n_estimators=500,\n",
    "                       max_features=0.8,\n",
    "                       bootstrap=True,\n",
    "                       warm_start=True,\n",
    "                       random_state=4430)\n",
    "\n",
    "isof.fit(X2)\n",
    "\n",
    "isof_scores = -isof.score_samples(X2)\n",
    "print(isof_scores)\n",
    "\n",
    "train2['ISOF'] = isof_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:11:04.117553Z",
     "start_time": "2020-08-30T13:10:47.233705Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2.45346488 5.38521413 2.45613559 ... 2.02880599 2.90128672 4.58258082]\n"
     ]
    }
   ],
   "source": [
    "from pyod.models.knn import KNN\n",
    "\n",
    "knn = KNN(n_neighbors=50)\n",
    "\n",
    "knn.fit(X2)\n",
    "\n",
    "knn_scores = knn.decision_scores_\n",
    "\n",
    "print(knn_scores)\n",
    "train2['KNN'] = knn_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:11:22.498688Z",
     "start_time": "2020-08-30T13:11:07.260665Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[867.5293374  855.68150254 867.26973454 ... 868.44253725 866.04242997\n",
      " 859.7618748 ]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.svm import OneClassSVM\n",
    "\n",
    "svm = OneClassSVM(gamma='auto')\n",
    "svm.fit(X2)\n",
    "\n",
    "svm_scores = svm.score_samples(X2)\n",
    "\n",
    "print(svm_scores)\n",
    "\n",
    "train2['SVM'] = svm_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:12:19.681194Z",
     "start_time": "2020-08-30T13:12:19.588479Z"
    }
   },
   "outputs": [],
   "source": [
    "svm_mean = train2['SVM'].mean()\n",
    "train2['SVM'] = train2['SVM'] - svm_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:12:21.549375Z",
     "start_time": "2020-08-30T13:12:21.511640Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "      <th>LOF</th>\n",
       "      <th>ISOF</th>\n",
       "      <th>KNN</th>\n",
       "      <th>SVM</th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.154930</td>\n",
       "      <td>0.248826</td>\n",
       "      <td>0.026642</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.057568</td>\n",
       "      <td>0.307138</td>\n",
       "      <td>2.453465</td>\n",
       "      <td>2.918719</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.029734</td>\n",
       "      <td>0.128326</td>\n",
       "      <td>0.069143</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.062215</td>\n",
       "      <td>0.342095</td>\n",
       "      <td>5.385214</td>\n",
       "      <td>-8.929116</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.153365</td>\n",
       "      <td>0.233177</td>\n",
       "      <td>0.025227</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.069759</td>\n",
       "      <td>0.305884</td>\n",
       "      <td>2.456136</td>\n",
       "      <td>2.659116</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.016642</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.798886</td>\n",
       "      <td>0.304109</td>\n",
       "      <td>2.243133</td>\n",
       "      <td>3.228893</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.017214</td>\n",
       "      <td>0.364632</td>\n",
       "      <td>0.324983</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.653739</td>\n",
       "      <td>0.302209</td>\n",
       "      <td>1.786517</td>\n",
       "      <td>4.221385</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1758</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.825532</td>\n",
       "      <td>0.303707</td>\n",
       "      <td>2.236424</td>\n",
       "      <td>3.471488</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1759</th>\n",
       "      <td>0.061033</td>\n",
       "      <td>0.311424</td>\n",
       "      <td>0.083310</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.695726</td>\n",
       "      <td>0.309823</td>\n",
       "      <td>3.325164</td>\n",
       "      <td>-0.039661</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1760</th>\n",
       "      <td>0.148670</td>\n",
       "      <td>0.339593</td>\n",
       "      <td>0.037823</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.913555</td>\n",
       "      <td>0.303823</td>\n",
       "      <td>2.028806</td>\n",
       "      <td>3.831919</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1761</th>\n",
       "      <td>0.023474</td>\n",
       "      <td>0.125196</td>\n",
       "      <td>0.084352</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.202233</td>\n",
       "      <td>0.313282</td>\n",
       "      <td>2.901287</td>\n",
       "      <td>1.431812</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1762</th>\n",
       "      <td>0.054773</td>\n",
       "      <td>0.062598</td>\n",
       "      <td>0.018955</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.319866</td>\n",
       "      <td>0.331034</td>\n",
       "      <td>4.582581</td>\n",
       "      <td>-4.848744</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1763 rows × 1563 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0      0.154930   0.248826   0.026642        0.0        0.0        0.0   \n",
       "1      0.029734   0.128326   0.069143        1.0        0.0        0.0   \n",
       "2      0.153365   0.233177   0.025227        1.0        0.0        0.0   \n",
       "3      0.061033   0.061033   0.016642        0.0        0.0        0.0   \n",
       "4      0.017214   0.364632   0.324983        1.0        0.0        0.0   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "1758   0.000000   0.000000   0.033309        1.0        0.0        0.0   \n",
       "1759   0.061033   0.311424   0.083310        1.0        0.0        0.0   \n",
       "1760   0.148670   0.339593   0.037823        1.0        0.0        0.0   \n",
       "1761   0.023474   0.125196   0.084352        1.0        0.0        0.0   \n",
       "1762   0.054773   0.062598   0.018955        0.0        0.0        0.0   \n",
       "\n",
       "      feature_7  feature_8  feature_9  feature_10  ...  feature_1554  \\\n",
       "0           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1           0.0        0.0        0.0         1.0  ...           0.0   \n",
       "2           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "3           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "4           0.0        0.0        0.0         0.0  ...           0.0   \n",
       "...         ...        ...        ...         ...  ...           ...   \n",
       "1758        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1759        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1760        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1761        1.0        0.0        0.0         0.0  ...           0.0   \n",
       "1762        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "\n",
       "      feature_1555  feature_1556  feature_1557  feature_1558       LOF  \\\n",
       "0              0.0           0.0           0.0           0.0  2.057568   \n",
       "1              1.0           0.0           0.0           0.0  4.062215   \n",
       "2              0.0           0.0           0.0           0.0  2.069759   \n",
       "3              0.0           0.0           0.0           0.0  1.798886   \n",
       "4              0.0           0.0           0.0           0.0  1.653739   \n",
       "...            ...           ...           ...           ...       ...   \n",
       "1758           0.0           0.0           0.0           0.0  1.825532   \n",
       "1759           0.0           0.0           0.0           0.0  2.695726   \n",
       "1760           0.0           0.0           0.0           0.0  1.913555   \n",
       "1761           0.0           0.0           0.0           0.0  2.202233   \n",
       "1762           0.0           0.0           0.0           0.0  1.319866   \n",
       "\n",
       "          ISOF       KNN       SVM  Class  \n",
       "0     0.307138  2.453465  2.918719      0  \n",
       "1     0.342095  5.385214 -8.929116      0  \n",
       "2     0.305884  2.456136  2.659116      0  \n",
       "3     0.304109  2.243133  3.228893      0  \n",
       "4     0.302209  1.786517  4.221385      0  \n",
       "...        ...       ...       ...    ...  \n",
       "1758  0.303707  2.236424  3.471488      0  \n",
       "1759  0.309823  3.325164 -0.039661      0  \n",
       "1760  0.303823  2.028806  3.831919      0  \n",
       "1761  0.313282  2.901287  1.431812      0  \n",
       "1762  0.331034  4.582581 -4.848744      0  \n",
       "\n",
       "[1763 rows x 1563 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "train2['Class'] = train['Class']\n",
    "\n",
    "display(train2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T13:13:33.584655Z",
     "start_time": "2020-08-30T13:13:29.476582Z"
    }
   },
   "outputs": [],
   "source": [
    "train2.to_csv('./data/MH18_Train2.csv', index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prepare test data to include outlier features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T15:09:03.928703Z",
     "start_time": "2020-08-30T15:08:52.538242Z"
    },
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.77638695 1.66874525 1.87493092 2.60668422 3.10692031 1.66246505\n",
      " 2.06987738 1.97239483 1.32547034 1.43866962 3.45201488 2.02711916\n",
      " 1.24346127 1.16739139 2.65367086 2.44580749 3.73877293 1.88792625\n",
      " 1.58223506 2.54627905 1.21412744 2.09797061 3.18163137 1.4852441\n",
      " 2.19013521 2.77912039 2.34097164 2.58657274 1.96858204 3.68573509\n",
      " 1.56802255 1.42149328 1.79980817 1.21240379 1.75773532 2.12044982\n",
      " 1.48191089 0.98493557 2.20104811 3.40544811 1.00085222 2.24019419\n",
      " 1.90157162 1.0064748  2.90254741 1.25743184 2.49479903 3.67365962\n",
      " 2.69633421 2.09808295 2.82991438 1.93959177 3.35615976 2.08420024\n",
      " 1.59140658 1.30824325 2.56706815 1.21753364 1.55845414 3.82745875\n",
      " 3.64048476 2.80526378 0.98315109 1.87536144 1.43112591 1.63419183\n",
      " 1.36030689 2.82812728 0.98598303 2.54003653 0.97997654 1.23134133\n",
      " 2.42444223 1.03347242 2.26934753 1.42662432 1.40420973 3.2876957\n",
      " 1.5647416  0.98486589 0.9821441  1.8806862  2.6779284  2.03502753\n",
      " 2.18811852 1.38433381 1.38124686 2.0844291  2.66769383 1.77676429\n",
      " 3.24729554 1.68877654 2.50772234 1.39941863 1.93524036 2.01947918\n",
      " 2.05007182 1.30315378 2.41205852 1.68292451 2.96229655 2.10259776\n",
      " 1.77904853 2.45460448 2.12899795 1.91103289 1.93667762 2.45033056\n",
      " 1.45257663 2.08464189 2.773459   1.45393724 1.60488341 3.24528624\n",
      " 2.23313453 2.35270087 2.0463448  1.81321682 2.75273457 2.43004161\n",
      " 1.72304073 2.60134464 1.99407176 2.12569565 2.36360866 2.10034524\n",
      " 0.98610437 2.14903228 1.78730626 1.57662852 1.75566746 0.98150249\n",
      " 2.42238196 1.14306646 2.94781402 2.04109626 0.98451483 2.74040111\n",
      " 1.23609832 3.50724881 1.43964536 2.22580101 1.2284959  1.80342419\n",
      " 2.20043154 1.87747796 2.49522408 1.72973761 1.81725727 2.04429766\n",
      " 2.30353777 1.14011422 2.68981896 1.20857513 0.9813615  1.45325421\n",
      " 3.72715155 2.03510681 2.49489069 2.23678415 1.22740755 1.64492385\n",
      " 3.37169868 2.26347008 2.13602117 1.59287093 1.94293853 1.74346434\n",
      " 2.27467559 2.08830042 2.08468638 2.18571881 2.54053866 2.0534299\n",
      " 2.34849568 0.99323348 1.99537733 1.24300098 3.73877293 3.43438285\n",
      " 2.37600799 2.23749442 2.0252059  0.98652825 1.38123551 2.37006256\n",
      " 1.5789234  2.08934027 3.01543712 2.01209097 1.61039534 1.62427765\n",
      " 0.98525975 2.75863377 1.5504014  0.9924489  3.09202785 1.21820234\n",
      " 1.7871275  2.30503439 2.14257957 1.23190139 0.98056352 2.25545802\n",
      " 1.57176775 2.46494065 2.05564717 4.16448304 1.89066632 1.43889152\n",
      " 1.43465274 1.42233814 2.79549604 2.73060197 2.03193559 2.347378\n",
      " 1.44552764 3.07771972 1.99805376 2.24376967 1.00085709 2.49439147\n",
      " 2.01895909 1.85262658 0.9813471  0.98693451 1.61687121 2.61046974\n",
      " 1.32931805 1.31017618 2.55128675 2.03845164 2.92060183 1.87947214\n",
      " 2.24006895 2.10209078 3.15035304 1.20980174 1.33795869 2.46169335\n",
      " 1.40255586 2.67790867 1.64189189 0.98221064 1.93925054 2.07004379\n",
      " 2.23011341 1.91314251 1.80308888 1.54133535 2.15060013 2.27440699\n",
      " 1.94316858 2.77296278 1.98325806 1.17691624 3.42308993 2.3351781\n",
      " 1.62385004 1.70336438 1.7812499  2.66126407 2.678399   1.70257675\n",
      " 1.96923329 2.11808573 2.12196659 1.67464973 2.26452199 1.00097695\n",
      " 2.49478413 2.54791733 2.23107644 2.21172136 2.74234313 1.00462762\n",
      " 2.32809521 2.24216888 1.23609832 2.23788976 2.34584523 2.55042159\n",
      " 1.76590014 2.05187176 1.23609832 1.94707479 2.36263911 1.83695275\n",
      " 0.98075891 2.04049157 1.33687939 2.22870278 1.42641574 1.93327345\n",
      " 2.11326738 2.28204124 2.41309077 2.14252353 1.68370678 1.89504869\n",
      " 1.77979601 3.66330508 2.06396741 1.85854503 1.23125453 2.67816862\n",
      " 1.76262759 1.99185801 2.32341812 3.55074266 2.02776657 2.41938675\n",
      " 2.3293422  2.05242336 1.80768204 2.13615617 1.13322382 1.5149356\n",
      " 1.97115193 1.67955269 2.02426617 1.75923123 2.70452202 1.6213938\n",
      " 1.68768972 2.70589535 1.9622793  2.78192417 1.0022016  1.15987658\n",
      " 2.58027861 1.57880033 1.13975233 1.49034592 2.16153611 1.59833245\n",
      " 2.49489069 2.734651   3.0362435  2.70692945 1.91316458 2.5718639\n",
      " 2.0540801  1.00235957 2.22978465 0.99868716 2.04421179 1.95154225\n",
      " 2.39286553 2.14693848 2.44095915 2.63239353 2.01730947 0.98477613\n",
      " 2.6825304  2.23326544 2.05433703 1.65531231 2.15440471 1.88947442\n",
      " 1.60190992 1.9180374  1.88775332 2.18172104 3.62490277 2.33264609\n",
      " 1.55694699 0.98234894 0.98096681 2.45204057 3.44578479 3.76869785\n",
      " 1.453324   2.61430947 2.83045911 2.4720231  0.98293722 1.52734869\n",
      " 1.43187456 1.72370474 1.24566019 2.43840819 2.33628663 2.41794841\n",
      " 1.83716687 2.64658221 1.74194018 0.98063287 2.00261375 2.23772164\n",
      " 2.06080896 2.15437018 1.93366616 1.65059896 3.09052683 1.70723869\n",
      " 2.21587964 2.21077436 1.25751554 1.83654127 0.98663037 1.9082431\n",
      " 1.66175421 1.62350426 1.33882806 2.64237528 1.32923124 3.00026237\n",
      " 0.98096681 2.38913735 1.39323665 1.62454436 1.77314983 0.98668259\n",
      " 2.26725333 3.23641437 1.76141049 0.98678553 1.51032364 3.01368064\n",
      " 2.08796928 3.48945783 1.13895669 1.79496304 1.65080906 1.44465765\n",
      " 2.00254279 2.05005281 2.34698307 2.39269025 2.27497529 2.22029245\n",
      " 2.85806506 2.37875036 1.49183772 1.4420827  2.24480505 1.89324747\n",
      " 1.44609624 2.05011055 1.44178615 1.78691739 3.77088572 2.0311447\n",
      " 3.6492712  2.13044981 2.11309363 2.40635475 2.42258092 3.04229021\n",
      " 2.5718639  2.77050562 2.5732547  2.05933381 1.99439556 2.42132329\n",
      " 2.35438326 1.04423628 1.31871392 1.42839803 1.79110395 1.5290036\n",
      " 0.9815863  1.88708439 1.8866131  2.26222022 1.75828899 1.87851877\n",
      " 3.4216691  3.68439631 1.19606666 1.99852217 1.37695912 2.0186448\n",
      " 2.62726829 1.64070841 0.98056352 2.1301348  1.496538   1.75543186\n",
      " 1.34986459 1.58732335 1.42495474 2.18808152 1.72363539 3.7839762\n",
      " 2.05424563 3.60783301 1.28307681 1.50201373 1.79581792 2.53235733\n",
      " 0.98096681 1.96768052 1.62082805 4.7902735  2.95732879 2.73138911\n",
      " 2.84166461 2.03389605 2.29048626 1.95858754 2.60950388 1.6305819\n",
      " 1.70314656 2.06836482 0.98096681 3.71756238 2.87595401 1.63010424\n",
      " 1.76379108 2.28858451 1.8451574  2.52567222 0.98113928 1.80165655\n",
      " 2.07097526 2.21033485 2.05362363 1.84675487 2.90514925 2.22469441\n",
      " 1.00400609 1.90906589 1.38391937 0.99588145 1.93362055 2.07002517\n",
      " 1.70734466 1.20265177 3.38517535 1.9098079  1.76566393 1.26097552\n",
      " 3.1333391  0.97949219 1.94381399 2.74078392 2.92057324 1.72336349\n",
      " 1.66310623 2.0984811  2.98214991 1.61513789 1.9258903  1.9152541\n",
      " 2.05564717 1.92217226 2.00251309 1.88893842 2.13701334 1.13241317\n",
      " 1.4415734  2.63299277 2.3067326  2.08778907 1.69250272 1.75236492\n",
      " 1.64139553 2.00460948 2.03992034 2.41939944 2.79841206 3.28401145\n",
      " 2.64734573 1.22573207 2.69760718 1.33319944 2.73141809 1.23952797\n",
      " 2.73805382 2.2792907  1.72116399 1.62131133 2.43720068 1.70705333\n",
      " 1.7253757  1.1754514  1.33529883 2.61099777 1.59189926 0.98096681\n",
      " 1.55367745 2.46289904 2.43755401 1.50384389 2.26574209 2.26264417\n",
      " 2.02894814 2.01073332 2.05419329 1.62783461 4.01616506 2.86113731\n",
      " 2.76523114 2.66938091 2.13158423 2.07378735 3.11316289 1.87175859\n",
      " 1.75689434 2.15881917 2.72400532 1.98231972 0.9867188  3.15730155\n",
      " 2.5815711  1.21591719 2.18874469 1.50091788 2.09972354 1.98838019\n",
      " 2.90960947 1.43732212 2.16055129 3.30477572 1.69323079 2.28224935\n",
      " 1.45047798 3.07091363 2.11646844 5.11139121 1.0064748  2.27166391\n",
      " 1.20502899 1.86385682 1.15990939 2.87516322 0.99130868 1.32010144\n",
      " 1.61990613 1.7616102  1.61373287 2.87118615 1.17900843 3.71410076\n",
      " 1.8283583  1.62026629 1.24051753 1.31024798 2.571434   1.13606395\n",
      " 1.87451909 1.25795454 2.03523978 1.22813936 2.2397364  1.89784923\n",
      " 2.53692329 1.92143282 1.73899679 2.43092503 1.99242202 2.73840083\n",
      " 1.64245745 2.60847162 2.8404435  1.80886826 2.23782744 1.79438174\n",
      " 2.28970824 1.90473769 2.04461556 1.26549542 1.58439875 2.28130411\n",
      " 5.13146813 1.66955731 1.60792929 2.5833918  2.32767111 2.05402857\n",
      " 1.24933963 2.04874011 2.3738266  1.32118083 2.32341812 1.41254017\n",
      " 2.26574209 3.67365962 1.63674116 1.63731088 1.21692798 2.20038999\n",
      " 1.6427418  1.22780098 2.39534716 2.49961666 2.07442535 2.05017859\n",
      " 2.19085815 2.82594303 1.13534818 2.82245391 0.98667396 1.95393044\n",
      " 2.49626773 2.20877    1.78675176 2.58189681 1.44440034 2.3327637\n",
      " 2.32033548 2.75813364 3.60783301 2.73506573 2.05006046 2.452477\n",
      " 2.43504929 2.10893142 1.53432072 2.0312467  2.09449946 1.79932104\n",
      " 4.74147256 2.03148144 1.36934194 1.99995807 3.20353165 1.76514927\n",
      " 0.98096681 2.0397874  1.65804092 1.91006067 0.98136453 2.38467347\n",
      " 2.48553314 2.06073473 1.22162879 1.56781389 1.76800773 1.87703156\n",
      " 1.6125435  0.98096681 0.98455852 1.63243953 1.25639528 0.98664509\n",
      " 2.51313927 1.63707873 1.97032225 2.48850518 2.32470086 1.21267558\n",
      " 1.6134295  1.63348017 3.27325904 2.21626101 1.64260419 2.20724255\n",
      " 1.32401233 1.88637151 2.74411117 1.64044841 2.02796424 2.10729962]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\sc4430\\Anaconda3\\lib\\site-packages\\sklearn\\ensemble\\_bagging.py:352: UserWarning: Warm-start fitting without increasing n_estimators does not fit new trees.\n",
      "  warn(\"Warm-start fitting without increasing n_estimators does not \"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.3047958  0.30940798 0.30926715 0.31681611 0.33447277 0.30267301\n",
      " 0.3200375  0.32429478 0.30093515 0.3054993  0.35084499 0.30822527\n",
      " 0.30234935 0.29944755 0.31796407 0.30460216 0.35266113 0.30925545\n",
      " 0.30169898 0.31883994 0.29971307 0.31420786 0.33095571 0.32233349\n",
      " 0.31458834 0.32023044 0.3156228  0.32333159 0.31138829 0.35576393\n",
      " 0.30414275 0.30345997 0.30541997 0.29898739 0.33636684 0.31368892\n",
      " 0.30291804 0.29790138 0.31270954 0.33942405 0.29873359 0.3115099\n",
      " 0.30858838 0.29816833 0.32019482 0.30065994 0.31979421 0.33699853\n",
      " 0.32248717 0.3095755  0.31987175 0.3345035  0.37632361 0.31420786\n",
      " 0.31527418 0.30172505 0.33191443 0.30113746 0.33954547 0.34245842\n",
      " 0.35572365 0.31789384 0.29858362 0.32554053 0.30170727 0.30593486\n",
      " 0.30190196 0.33020977 0.29790138 0.33805685 0.29916231 0.30146634\n",
      " 0.30978094 0.29955052 0.3058564  0.32638335 0.32491908 0.30600843\n",
      " 0.32218185 0.29790138 0.29835301 0.3125997  0.3141822  0.30608543\n",
      " 0.31669724 0.30346838 0.32326193 0.31420786 0.3076264  0.30382447\n",
      " 0.32090236 0.30313512 0.31322627 0.29971307 0.30831977 0.30684519\n",
      " 0.32832667 0.32460509 0.32959187 0.31871718 0.31828633 0.31224333\n",
      " 0.30590497 0.31043638 0.32106492 0.3340671  0.30526176 0.31485923\n",
      " 0.3370071  0.31183997 0.31363416 0.33841389 0.3030045  0.3365879\n",
      " 0.31310182 0.3136722  0.30979138 0.30768919 0.33894907 0.32527867\n",
      " 0.30402921 0.30361015 0.31081901 0.30883132 0.33083907 0.31263116\n",
      " 0.29790138 0.31307569 0.33036027 0.30804719 0.30717074 0.298306\n",
      " 0.31386357 0.30049259 0.32875292 0.31016927 0.29825294 0.3156568\n",
      " 0.30174614 0.33723565 0.30180136 0.30922501 0.30054026 0.30183774\n",
      " 0.30943748 0.30809932 0.32103624 0.30870667 0.31121981 0.30598175\n",
      " 0.31697322 0.30034666 0.31711748 0.2997099  0.30063979 0.30635523\n",
      " 0.33753077 0.32467293 0.31934415 0.3208052  0.30159465 0.30380989\n",
      " 0.33266578 0.30900307 0.31006226 0.30330298 0.33625712 0.30265627\n",
      " 0.33067601 0.325569   0.30961504 0.30933429 0.31713645 0.32140489\n",
      " 0.31821856 0.29873359 0.32862874 0.32743319 0.35266113 0.34937498\n",
      " 0.31526155 0.31397369 0.33421604 0.29851561 0.32326193 0.30300615\n",
      " 0.3190416  0.30996014 0.33639601 0.30997411 0.30235418 0.30468159\n",
      " 0.29790138 0.33360474 0.33597717 0.29834459 0.33211973 0.29912525\n",
      " 0.30952293 0.32067702 0.31578523 0.3009395  0.29952186 0.31251571\n",
      " 0.3194429  0.30576608 0.30800383 0.36860615 0.31312963 0.32533473\n",
      " 0.30233715 0.32613819 0.30674523 0.31507873 0.3090525  0.31945411\n",
      " 0.32760795 0.34145881 0.31846074 0.30766622 0.29873359 0.30667247\n",
      " 0.33205483 0.30723716 0.29952186 0.29790138 0.3047126  0.31768513\n",
      " 0.32555362 0.32427635 0.31833273 0.32032709 0.33152387 0.32983193\n",
      " 0.31384322 0.31121398 0.34146871 0.3007256  0.29932527 0.31776004\n",
      " 0.30262492 0.3141822  0.30416503 0.29799978 0.33504527 0.31061115\n",
      " 0.30749718 0.30744453 0.30517631 0.30218626 0.32450323 0.30973134\n",
      " 0.31042098 0.31442674 0.33157887 0.30002387 0.36073687 0.32034609\n",
      " 0.32294458 0.31049717 0.33291856 0.309728   0.3141822  0.31008965\n",
      " 0.31772642 0.3052943  0.3348946  0.30403136 0.31030377 0.29886518\n",
      " 0.31937376 0.30759302 0.31584204 0.33249969 0.3175419  0.29886518\n",
      " 0.30889052 0.3201641  0.30266012 0.32897162 0.31513523 0.33183393\n",
      " 0.30503063 0.30748079 0.30114318 0.33522658 0.31054455 0.30534983\n",
      " 0.29898479 0.32028375 0.30379837 0.31470674 0.30211084 0.31166894\n",
      " 0.30404858 0.32471358 0.31371564 0.32076179 0.30682821 0.31210922\n",
      " 0.30748219 0.33965164 0.32420717 0.32989485 0.3013847  0.3141822\n",
      " 0.33714069 0.32880766 0.29790138 0.35071395 0.30836105 0.30744592\n",
      " 0.3182501  0.32298801 0.31151765 0.30864531 0.29984812 0.30082431\n",
      " 0.32623977 0.3228906  0.32221401 0.31280459 0.31182492 0.30279161\n",
      " 0.3137264  0.32052676 0.3182313  0.31996401 0.29876649 0.30051981\n",
      " 0.3281273  0.31520504 0.29913684 0.30336956 0.31499519 0.30647775\n",
      " 0.31934415 0.33323997 0.32032083 0.31627681 0.30762422 0.31787627\n",
      " 0.32091102 0.29876649 0.31509219 0.29886518 0.30809993 0.34505202\n",
      " 0.31706534 0.30842659 0.32801816 0.31638253 0.30617461 0.29790138\n",
      " 0.32289107 0.30810678 0.32680015 0.30554189 0.3138516  0.31345659\n",
      " 0.30209821 0.31089621 0.33663792 0.31044765 0.34170015 0.31005523\n",
      " 0.30062662 0.29830167 0.29967995 0.31992077 0.34060539 0.34018808\n",
      " 0.30121128 0.31026638 0.335102   0.30867642 0.29916797 0.32047234\n",
      " 0.30425574 0.30403833 0.3021199  0.32688166 0.31005523 0.32963723\n",
      " 0.30777613 0.31679997 0.30293107 0.29984673 0.31895083 0.31266017\n",
      " 0.33667867 0.31586637 0.32707428 0.31918839 0.33767205 0.30620485\n",
      " 0.31537896 0.31231774 0.30229705 0.33563502 0.29790138 0.30208732\n",
      " 0.30737846 0.30348423 0.30057244 0.31108197 0.30046801 0.3306373\n",
      " 0.29906834 0.332665   0.30002711 0.30242254 0.30522605 0.29790138\n",
      " 0.32024188 0.33000582 0.30503063 0.29790138 0.30346328 0.33244079\n",
      " 0.31420786 0.34872841 0.29933857 0.32931537 0.32748993 0.30414519\n",
      " 0.31808536 0.32832667 0.31280758 0.33412416 0.3169214  0.31621762\n",
      " 0.33498546 0.31448339 0.30259424 0.30387604 0.32468466 0.30801386\n",
      " 0.32702913 0.32837111 0.32015186 0.3169291  0.34118565 0.3120928\n",
      " 0.33747864 0.31045807 0.31403114 0.31289285 0.32729177 0.33916804\n",
      " 0.31707237 0.3190607  0.33128429 0.3063586  0.30672075 0.31256015\n",
      " 0.32148718 0.29920955 0.32486431 0.32412674 0.30680666 0.33025261\n",
      " 0.2987051  0.32037019 0.335169   0.31215662 0.30580521 0.31388144\n",
      " 0.30427477 0.34252725 0.2994465  0.31970046 0.30222993 0.30725924\n",
      " 0.31329415 0.32516021 0.29870307 0.31089328 0.30367168 0.31645828\n",
      " 0.30424915 0.30544387 0.32616214 0.31755894 0.32782776 0.33228928\n",
      " 0.32091102 0.35458678 0.30279343 0.30214546 0.31963268 0.31427547\n",
      " 0.29943349 0.32700543 0.30456906 0.39320366 0.33703447 0.31268873\n",
      " 0.32139567 0.31168799 0.31821516 0.3203832  0.31291277 0.30456906\n",
      " 0.32289898 0.31378047 0.30039315 0.33708942 0.30473359 0.30749135\n",
      " 0.30624108 0.32288551 0.31752359 0.31884613 0.29868313 0.32221301\n",
      " 0.32327844 0.30537488 0.3064441  0.30793864 0.31527991 0.31130884\n",
      " 0.29908613 0.30832531 0.30117076 0.29826683 0.34176475 0.33053988\n",
      " 0.30721546 0.29991853 0.35060325 0.30666348 0.31612388 0.30067308\n",
      " 0.33784442 0.29830055 0.30612107 0.33904608 0.3276189  0.31884095\n",
      " 0.30895173 0.31686059 0.32885267 0.30245    0.30365283 0.32484062\n",
      " 0.30800383 0.30483801 0.31895083 0.30702962 0.31022278 0.3006179\n",
      " 0.30607685 0.33108543 0.32798639 0.31179665 0.32339787 0.3065026\n",
      " 0.30330463 0.30567465 0.31213524 0.31034788 0.31502136 0.33169584\n",
      " 0.32173067 0.30096158 0.30843741 0.29816833 0.31526305 0.30120437\n",
      " 0.31671018 0.3158542  0.31266972 0.30617923 0.31834179 0.30589572\n",
      " 0.30402921 0.29913315 0.30313766 0.33078989 0.30382097 0.29829631\n",
      " 0.30340566 0.31518865 0.32957762 0.30315115 0.31863891 0.3131586\n",
      " 0.326275   0.3105475  0.32182773 0.32273481 0.35943873 0.33528876\n",
      " 0.33520737 0.31441142 0.31393802 0.31327576 0.33057594 0.30671435\n",
      " 0.32244649 0.31602079 0.32017426 0.3262057  0.29972383 0.35251181\n",
      " 0.32599794 0.29987071 0.31442414 0.33567117 0.31317836 0.30773231\n",
      " 0.33027178 0.29975705 0.31703567 0.33938406 0.30771904 0.31597072\n",
      " 0.30180136 0.33513099 0.31480659 0.38023006 0.29816833 0.31718294\n",
      " 0.30037191 0.30675846 0.29977164 0.3422731  0.29816833 0.3022542\n",
      " 0.30560837 0.30692107 0.30592421 0.30473359 0.29943606 0.36508159\n",
      " 0.30988815 0.31412605 0.30237822 0.32358512 0.33201325 0.29921853\n",
      " 0.33962062 0.30228119 0.31022578 0.30065539 0.3170309  0.30265876\n",
      " 0.31659639 0.30483801 0.3329875  0.32021267 0.30975045 0.31735832\n",
      " 0.30468159 0.3062788  0.3154734  0.30708875 0.31266017 0.30713038\n",
      " 0.33692889 0.30584692 0.30827911 0.30098894 0.30337749 0.30876694\n",
      " 0.38648701 0.31037189 0.31667259 0.31610733 0.31246601 0.32192869\n",
      " 0.30064401 0.31746741 0.31817768 0.30431842 0.29790138 0.30315059\n",
      " 0.31863891 0.33445632 0.31996185 0.30377749 0.29858362 0.31428658\n",
      " 0.30371577 0.29912525 0.31642695 0.32504659 0.31157863 0.32841554\n",
      " 0.31242442 0.33194235 0.29943208 0.33189714 0.29790138 0.31380643\n",
      " 0.31150734 0.3034219  0.30714975 0.30828764 0.30402117 0.30923078\n",
      " 0.3177091  0.32124909 0.35458678 0.31749594 0.30685278 0.32187298\n",
      " 0.31976471 0.32385626 0.30189979 0.30577171 0.30893778 0.3160282\n",
      " 0.36444206 0.3191442  0.30213327 0.31947063 0.31897391 0.30525614\n",
      " 0.2995976  0.31174406 0.30337454 0.32083368 0.29790138 0.33155981\n",
      " 0.31491134 0.30620001 0.29900384 0.30430693 0.30627959 0.30671435\n",
      " 0.30385335 0.29837089 0.29790138 0.30256907 0.30392515 0.29790138\n",
      " 0.30299283 0.30758141 0.31014766 0.32738462 0.31680992 0.29898739\n",
      " 0.30378372 0.30190743 0.32834155 0.30926486 0.31972626 0.31059206\n",
      " 0.30172505 0.30973331 0.33077356 0.31431585 0.30801688 0.3125831 ]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2.55302524 3.47932    2.85931594 3.67667484 5.00287102 2.45653155\n",
      " 4.30720115 4.18099434 2.00455129 2.24134372 5.69758301 3.0200445\n",
      " 2.         1.76145748 4.24971047 3.32296409 5.93922198 3.62525034\n",
      " 2.27315351 3.46811477 1.76180919 3.16308693 4.36101001 4.24371238\n",
      " 4.00071031 4.24352946 3.60623446 4.00253544 3.01088694 6.03877658\n",
      " 2.85575819 2.01217995 2.68505648 1.73757963 5.1994043  3.607276\n",
      " 2.23898765 1.04900401 3.17149234 5.31133346 1.41485384 3.17552678\n",
      " 3.00086332 1.42140003 4.24311192 2.         3.81053446 5.47914504\n",
      " 4.79680949 3.3174896  4.0059661  5.48125102 7.37357636 3.16278628\n",
      " 3.87753829 2.0078037  4.47326334 1.7459336  5.19758852 5.48163152\n",
      " 5.9554028  3.88716258 1.43464086 4.24782481 2.23606798 2.48364061\n",
      " 2.06088798 4.3602796  1.06756796 5.8607096  1.44069118 1.74746307\n",
      " 3.50001036 1.52030294 3.16990286 4.79653454 4.69115743 4.36756123\n",
      " 4.69263513 1.05349863 1.18073411 3.61335832 3.87803418 2.83705272\n",
      " 4.24287197 2.13353737 4.58332223 3.16257398 3.74803473 3.17971365\n",
      " 4.63874314 2.51044811 3.67536172 2.01190566 2.83071577 2.83703723\n",
      " 4.59311234 4.58321333 5.29630064 4.3601608  4.18722444 3.31877379\n",
      " 2.8294003  3.39889782 4.39061058 5.00003211 2.87316017 3.32469956\n",
      " 5.39283997 3.20239139 4.0003586  5.47803485 2.45700433 5.31993801\n",
      " 3.3198764  3.47116613 3.00375013 3.48305635 5.1121469  4.35889894\n",
      " 3.01937025 3.74343463 3.00014547 3.00348738 4.70723763 3.46929594\n",
      " 1.05975549 3.1745259  4.47289103 2.25158608 2.64864394 1.43304822\n",
      " 3.62499893 1.76764853 4.82652944 3.31662479 1.07614409 3.87921179\n",
      " 1.75373632 5.38524585 2.23727713 3.33481197 1.74746307 2.46487141\n",
      " 3.08753113 2.74054653 3.74503828 2.84159169 3.68130163 3.00819946\n",
      " 3.48289591 1.73551346 4.00633608 1.7370458  1.43688373 2.26029586\n",
      " 5.56965263 4.48977573 3.76892211 3.46441789 1.74147774 2.44997178\n",
      " 5.02508701 3.31698081 3.08511554 2.44988964 5.29151772 2.64575131\n",
      " 5.10421774 4.58367509 3.00640559 3.25490713 3.91093166 4.38261964\n",
      " 3.60578924 1.41796042 5.29156757 4.58339796 5.93922198 6.00088425\n",
      " 3.60555128 3.74316433 5.29255295 1.05343113 4.58331524 3.46444248\n",
      " 4.24335988 3.23739303 5.00098591 3.00519041 2.24230405 2.45506088\n",
      " 1.0191584  4.47213595 5.47819472 1.42252223 4.93755943 1.75150862\n",
      " 3.35917792 4.29502645 3.47892284 2.00039671 1.44595374 3.60875366\n",
      " 4.00137504 3.74165739 5.19894324 7.38593134 3.87536667 4.81607996\n",
      " 2.23606798 4.79653819 3.87978607 3.75222722 2.8369498  3.75094483\n",
      " 4.89966877 5.19792971 4.12570712 3.18249228 1.41452212 3.47114796\n",
      " 4.80074009 2.82842712 1.43379243 1.03052407 2.31055815 3.74334457\n",
      " 4.58378485 4.79729245 4.00107444 3.16270441 4.83244656 4.1243275\n",
      " 3.31722757 3.16455378 5.41239085 1.77967044 2.00300728 3.47098896\n",
      " 2.23714786 3.87822458 2.4521301  1.0708482  5.24225263 3.0059745\n",
      " 3.17156974 2.65569953 2.4873589  2.24285882 4.3602346  3.32871483\n",
      " 3.02435379 3.74527224 5.00107503 1.75474532 6.57289851 4.24603436\n",
      " 4.60062938 3.39628454 4.83297922 3.74810407 3.87810363 2.66553825\n",
      " 4.06841268 3.16276176 5.69548074 2.50100967 3.31759484 1.42501507\n",
      " 3.74565385 3.65190244 3.00737871 4.90438974 4.00603097 1.42334063\n",
      " 3.33214797 3.38566492 1.75373632 5.10937057 3.16715782 4.47246153\n",
      " 2.68895303 2.83196089 1.75373632 5.48187852 3.61228293 2.55968391\n",
      " 1.43670377 3.16237862 2.00422088 4.12379473 2.01217995 3.20055366\n",
      " 3.16227766 4.83352792 3.6150428  3.31704597 2.45276122 3.61572615\n",
      " 2.8775707  5.6569314  4.49263533 5.00001598 1.74948124 3.87921179\n",
      " 5.38825835 4.79598295 3.17074553 5.78883367 3.01863315 3.60597587\n",
      " 4.         4.69556005 3.74165739 3.20842246 1.73205081 2.23699515\n",
      " 4.12462011 4.49116624 4.24427471 4.00336255 3.74803473 2.34902914\n",
      " 3.89187819 4.27424135 4.03453358 4.12327296 1.42200813 1.83386934\n",
      " 4.1284358  4.24335988 1.73486641 2.12969087 3.60893183 3.06226076\n",
      " 3.76892211 4.47213595 4.50323968 4.14657202 3.51153026 4.04186604\n",
      " 4.38597166 1.42144753 4.00081363 1.43775199 3.00192676 5.43085323\n",
      " 3.74523992 3.31864803 4.13410431 4.         3.00014547 1.0333356\n",
      " 4.58562665 3.21155249 4.38597166 3.2483814  3.60978134 3.91062182\n",
      " 2.24696866 3.00070307 5.48045855 3.21909004 5.65791818 3.17168091\n",
      " 2.45135288 1.16747253 1.4627718  3.74686375 5.15286151 5.74601334\n",
      " 2.01880932 3.6089645  4.58257569 3.60555128 1.44069118 4.49374798\n",
      " 2.03240366 2.45808976 2.         4.50584673 3.17142487 4.13410431\n",
      " 3.0341288  3.80013137 2.82842712 1.45707985 4.12446348 3.74309852\n",
      " 5.65686548 4.14786377 5.09904231 4.58257569 5.32115164 2.70028245\n",
      " 3.38088222 3.32013612 2.         5.11663121 1.05010204 2.82842712\n",
      " 2.45425834 2.2480274  2.00300728 3.87698707 2.00300728 4.6424112\n",
      " 1.4627718  5.10573033 2.00427796 2.45663186 2.649183   1.0467403\n",
      " 4.03910766 4.82198086 2.70905366 1.04011426 2.23931081 4.6912197\n",
      " 3.16227766 5.22510674 1.73205081 4.47286645 4.63345322 2.24548063\n",
      " 4.12555411 4.59300382 3.60842385 5.32014757 3.87569951 3.74605802\n",
      " 5.15286151 3.32080464 2.23875817 2.24227583 3.49402027 2.82858142\n",
      " 4.89966678 4.59333106 4.24365417 3.9195653  5.38964601 3.16865208\n",
      " 5.20079649 3.16426412 3.46753784 3.77877859 4.47216359 5.21710083\n",
      " 4.04186604 4.00466622 4.60136155 2.83311225 3.00316198 3.44620423\n",
      " 4.0415038  1.59196727 4.79729245 4.58340502 2.54768423 4.79667649\n",
      " 1.21684578 4.0088735  5.29566924 3.16990286 2.45942681 3.05395146\n",
      " 4.58842317 5.91623287 1.88467019 4.1253229  2.00384688 3.05158287\n",
      " 3.7435526  4.47757874 1.44595374 3.16982078 2.24091893 3.67160914\n",
      " 2.02610319 3.02874844 4.7965393  4.24287197 4.40703113 5.0075534\n",
      " 4.38671639 5.50265096 2.06776525 2.23940404 3.68130163 3.74205527\n",
      " 1.4627718  4.18099434 2.45280066 8.39952271 4.89897949 4.003319\n",
      " 4.12820036 3.89932993 4.01637008 4.16027043 3.74810407 2.45671988\n",
      " 4.60114922 3.48299133 1.4627718  5.65832743 3.877249   2.65366677\n",
      " 2.4630519  4.04700486 3.81410213 3.74323296 1.24578558 4.36156333\n",
      " 4.49263533 3.31936876 2.83311225 2.82884459 4.12456521 3.46880511\n",
      " 1.45602673 3.31725055 2.00758952 1.44867469 5.29151772 4.90294157\n",
      " 3.16284759 1.75319254 6.00212748 2.68786845 3.60555128 2.00121534\n",
      " 4.9463949  1.42899901 3.00324058 5.11659627 4.69056285 4.58344419\n",
      " 2.35626435 4.24264069 4.59578516 2.45200911 2.65075932 4.24866088\n",
      " 5.19894324 2.65346017 4.12404872 2.84559635 3.16945594 1.73337705\n",
      " 2.23927865 4.24264069 4.59004164 3.16254763 4.24514585 2.64842883\n",
      " 3.         3.00974598 3.00128517 3.6059425  3.88018997 4.70304483\n",
      " 3.60921945 1.74720919 3.6102209  2.00508804 3.74581246 2.00237998\n",
      " 3.74520449 4.00811104 3.62584002 2.44948974 3.74787081 2.70738845\n",
      " 3.03178529 1.73919746 1.9744649  4.6904981  2.2468387  1.4627718\n",
      " 2.44974568 3.74165739 5.29395346 2.23875817 4.28904981 3.46576363\n",
      " 4.2450684  3.17811413 4.38597166 4.58304161 7.03931685 4.69041576\n",
      " 5.30314935 3.68725549 3.16764234 3.46796905 5.00854233 3.00398392\n",
      " 5.00048559 3.33286847 4.0010638  4.58714975 1.47587652 6.00819692\n",
      " 4.69047673 1.74171267 4.25582338 5.56777249 3.47050668 3.0013185\n",
      " 4.17624214 2.25033573 3.74519672 5.33401137 2.89180578 3.87314422\n",
      " 2.23778491 5.22603506 3.33995526 7.2844936  1.42140003 3.31854563\n",
      " 1.73967655 3.00085356 1.74860053 5.29566402 1.42017651 2.00747789\n",
      " 2.44948974 2.64802533 2.2480274  3.88920686 1.73792349 6.4382977\n",
      " 2.82981218 3.87678558 2.00412624 4.7961407  4.6934362  1.73425711\n",
      " 5.38889195 2.00675294 2.83313833 1.80499334 3.61831617 2.65497046\n",
      " 4.02716427 2.65292671 5.04050554 4.00364743 3.00490821 3.92950359\n",
      " 2.4556952  3.60756991 4.00697819 3.33117347 3.74397164 2.86583155\n",
      " 5.49669422 2.8330503  3.0070391  2.01989023 2.27227996 3.46521\n",
      " 7.61861437 3.3368677  4.35959896 3.60934723 3.60555128 4.38249314\n",
      " 2.00765235 4.36032306 3.87675028 2.1254626  3.17074553 2.23606798\n",
      " 4.28904981 5.47914504 4.35989049 2.82862883 1.76316834 4.16748474\n",
      " 2.45611186 1.74746307 3.88250125 4.24891334 3.16368966 4.59352806\n",
      " 3.31882336 4.3602796  1.75043164 4.58257569 1.04729629 3.74181211\n",
      " 3.53703199 3.16558627 2.87926908 3.61230955 2.23606798 3.3645268\n",
      " 3.60710682 4.00356956 5.50265096 3.88384379 2.84460993 4.24406669\n",
      " 4.12329144 4.58485773 2.30268316 2.83321404 3.16375144 3.60555128\n",
      " 6.6721764  4.28520619 2.23825351 4.12310563 4.4760771  2.68319742\n",
      " 1.4627718  3.00565433 2.45371665 3.9436001  1.09762192 5.51086457\n",
      " 3.48437865 3.00132203 1.73768908 2.45006535 2.82842712 3.00268552\n",
      " 2.24539723 1.4627718  1.0473705  2.44985946 2.         1.0491546\n",
      " 3.47170563 2.83568061 3.0015053  4.47311549 3.46594386 1.73820213\n",
      " 2.24783006 2.24959654 4.90203805 3.35436023 4.24402316 3.00892459\n",
      " 2.00212675 2.86439765 4.47213595 3.87598177 2.83212578 3.31723633]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[372.0509953  371.45632172 371.5179067  370.3777629  367.92088548\n",
      " 372.09407895 369.88343826 370.09074562 372.58522874 372.34498855\n",
      " 366.09524538 371.31750118 372.60588737 372.80269329 369.17156081\n",
      " 370.78173917 365.422572   371.17760525 372.24314786 370.57635724\n",
      " 372.73522711 371.15536707 368.90260447 370.09879255 369.99170859\n",
      " 369.36605551 370.58213918 369.95529469 371.30900344 365.15436459\n",
      " 372.28057652 372.45095329 371.7697488  372.67641165 368.08444911\n",
      " 370.85404608 372.24459586 373.15580189 371.06329052 367.06187492\n",
      " 373.05019185 371.02341275 371.41079905 373.03437081 369.51932079\n",
      " 372.57493294 370.05072787 366.66586153 368.79885762 371.44001359\n",
      " 369.75634785 367.41381209 361.28424212 371.15601439 370.70438064\n",
      " 372.57793577 369.15764684 372.71954578 368.16946096 366.61015452\n",
      " 365.42122082 369.8794241  372.91211495 369.93335776 372.37079203\n",
      " 372.00362359 372.38118658 369.05082958 373.14476615 366.54856007\n",
      " 372.92030907 372.68247481 370.56190359 373.00079085 371.02981059\n",
      " 368.98359641 369.22063763 368.88137197 369.14888104 373.15441141\n",
      " 373.12470734 371.01448969 369.92370261 371.50986086 369.56179767\n",
      " 372.46396262 369.44779889 371.1556049  370.13380607 371.95213383\n",
      " 368.66116513 372.01362637 370.54204897 372.48643179 371.63800816\n",
      " 371.93742571 369.19841962 369.45373685 367.71457539 369.96207221\n",
      " 369.54199135 370.82829409 371.53513062 370.81489445 369.65943131\n",
      " 368.70509498 371.51291734 370.81685719 367.54068128 370.97713983\n",
      " 369.7474723  367.5053851  372.14362094 367.17180461 370.96401668\n",
      " 370.62163117 371.41931983 371.41719012 367.92042095 369.75520038\n",
      " 372.15103221 370.19501632 371.42506658 371.6141505  369.05389647\n",
      " 370.81225123 373.14842033 371.3081794  369.73353669 372.22632484\n",
      " 371.90811782 372.91979736 370.51460193 372.80019942 368.44555283\n",
      " 370.96268839 373.15134205 369.96564451 372.68506851 366.91097174\n",
      " 372.34060059 370.87602968 372.67366768 371.96556359 371.33127489\n",
      " 371.68395205 370.16997247 371.53468781 371.0103319  371.44750509\n",
      " 370.61438105 372.821698   370.08173103 372.68077017 372.91720139\n",
      " 372.1484494  366.49144467 369.52437378 370.13688441 370.73238251\n",
      " 372.69996435 372.09055907 367.66178694 370.93489296 371.42843181\n",
      " 372.10943613 368.04007642 371.88152443 367.79474518 369.34863719\n",
      " 371.26779142 371.15810271 370.22026153 369.14844878 370.45243796\n",
      " 373.05668382 368.00928508 369.46963449 365.422572   365.50773881\n",
      " 370.47857363 370.30761338 368.01602245 373.15496654 369.44795949\n",
      " 370.69608318 370.20126384 371.0253501  367.78292105 371.30414533\n",
      " 372.33958799 372.1159284  373.1589578  368.95812085 367.47226944\n",
      " 372.91405747 368.11888481 372.69189042 371.71676673 369.40858306\n",
      " 370.50262153 372.60087856 372.9252739  370.58200203 370.65992541\n",
      " 370.23193323 367.8978997  361.15283235 370.80179637 368.76409332\n",
      " 372.32885055 369.01446126 369.87391265 370.11315896 371.52629478\n",
      " 370.29935946 368.77770237 367.7139492  369.82458293 371.03750387\n",
      " 373.04821628 370.56155536 368.76113443 371.65185805 372.92850224\n",
      " 373.15635034 372.1729194  370.34840132 369.46204795 369.00049377\n",
      " 369.77022519 371.19273605 368.2699043  370.26017796 371.11629115\n",
      " 371.14777638 367.03402367 372.72003325 372.55835201 370.58016604\n",
      " 372.37567446 369.92387881 372.09009906 373.15459427 368.05056792\n",
      " 371.27032928 371.04454218 371.87184336 371.96039121 372.22453509\n",
      " 369.94361288 370.91976967 371.2807931  370.11501114 368.63068728\n",
      " 372.81092139 363.8426784  369.71754441 369.38492179 371.48091379\n",
      " 368.88285    370.13017349 369.92123449 371.68866415 370.36222667\n",
      " 371.17311362 366.86845002 371.99013361 370.92032386 373.06047379\n",
      " 370.15551317 370.3420809  371.27789158 368.08429757 369.70035318\n",
      " 373.06018212 370.8112426  370.860662   372.69632998 368.02468786\n",
      " 371.03733104 369.16547741 371.67818381 371.49054751 372.68001858\n",
      " 367.38935309 370.81317483 371.98926343 372.91702796 371.18809057\n",
      " 372.58327715 369.77586075 372.45478244 370.93731567 371.15484005\n",
      " 368.68312414 370.72374465 370.96908301 372.09390428 371.00863045\n",
      " 371.41751375 366.22817004 368.88792977 368.72784779 372.71129315\n",
      " 369.92269003 367.67264165 369.16094407 370.99545825 365.87949632\n",
      " 371.31903915 370.47181002 370.39188753 368.99357855 371.03803666\n",
      " 371.13014678 372.80838873 372.32168018 370.27912681 369.60625812\n",
      " 369.57614974 370.63783721 370.25884821 372.28987234 370.68862849\n",
      " 369.17390777 370.36680039 369.55359462 373.06112137 372.74782768\n",
      " 369.79735801 370.22412149 372.8155865  372.39435914 370.8269636\n",
      " 372.05348348 370.13688441 368.95449521 368.94165507 369.67038064\n",
      " 371.17244143 369.61934359 369.1604024  373.06100898 369.98404937\n",
      " 373.05605973 371.37285858 367.60430986 370.28053008 370.96128623\n",
      " 369.36620457 369.68512247 371.44663022 373.15918043 368.87902931\n",
      " 371.01678635 369.12984955 371.74390218 370.59128544 370.57778047\n",
      " 372.19303417 371.45220121 367.40623744 371.34614355 366.30125686\n",
      " 371.00693946 372.72251236 373.11461157 372.91261731 370.2169155\n",
      " 367.34792656 366.06260944 372.44345009 370.3505995  368.73428325\n",
      " 370.55394025 373.02156855 369.5755008  372.48793305 372.00965782\n",
      " 372.58941617 369.29255234 371.00714089 369.40128463 371.1772496\n",
      " 370.27404405 372.25752658 372.91153316 369.81097686 370.37236882\n",
      " 367.12692958 370.03882881 368.4787218  369.55770293 367.16037228\n",
      " 371.64748463 370.81321914 370.94689563 372.57552769 368.32518386\n",
      " 373.15167844 371.62526076 372.09131569 372.22940971 372.55961517\n",
      " 369.99361916 372.56088654 368.76771696 372.90661437 367.80345551\n",
      " 372.45691519 372.03178948 371.91086333 373.15264056 369.95893036\n",
      " 368.12275765 371.68623971 373.154316   372.3558898  368.3982432\n",
      " 371.1460695  367.31909786 372.81217401 369.7411064  369.31064242\n",
      " 372.33699193 369.8305402  369.19854612 370.51665192 367.93367921\n",
      " 369.93891005 370.62369409 367.63544654 370.98377236 372.28399808\n",
      " 372.34257515 370.62154637 371.67211389 368.77474694 369.19816294\n",
      " 370.09119114 370.59506587 366.82370517 371.06146148 367.28607776\n",
      " 371.2510409  370.81245684 370.41596236 369.18611854 367.51434482\n",
      " 369.61528582 369.9536311  369.07895926 371.48741513 371.38034642\n",
      " 370.81245594 370.08666385 372.86866866 368.99668945 369.43660143\n",
      " 371.9157291  368.98269762 373.11169167 370.39218441 367.82527047\n",
      " 371.02958606 371.97702057 371.18843422 368.41948075 365.63987664\n",
      " 372.70431857 369.8043776  372.48566104 371.47344722 370.21494503\n",
      " 369.59863954 372.92775308 371.14154755 372.33106491 371.06853575\n",
      " 372.47919666 372.07700645 368.98519282 369.54280312 369.76609728\n",
      " 367.4811263  369.15883563 366.65250639 372.5454059  372.41351686\n",
      " 370.99771447 370.24691489 372.92046451 370.07315342 372.24789522\n",
      " 357.4757922  368.04999985 369.76376024 369.56658549 370.49517134\n",
      " 370.12536577 370.32065657 370.14341989 372.24733007 369.3653699\n",
      " 370.77658103 372.9242873  366.29010775 369.84940784 371.77008005\n",
      " 371.96504504 369.86479738 370.81190336 370.5278442  373.09906957\n",
      " 369.94520886 368.8956047  370.96509891 371.48615886 371.53197762\n",
      " 369.54420698 370.74756966 373.03892251 371.56744319 372.46734019\n",
      " 373.04452208 368.03292876 368.10855997 371.93911346 372.68951156\n",
      " 365.50044321 371.73800981 371.24683277 372.58247089 367.96365667\n",
      " 372.92098058 371.47269995 367.77318609 368.61152691 369.50428307\n",
      " 372.17389262 370.18326777 368.49139548 372.14730992 371.72340592\n",
      " 369.90045974 367.8978997  371.72862657 369.81233469 371.54400321\n",
      " 371.12347789 372.8308363  372.35962832 369.42320269 369.36085701\n",
      " 371.16428292 370.15735219 371.77571847 372.16720239 371.5732822\n",
      " 371.39550508 370.46725391 369.87177348 368.46923229 370.34548304\n",
      " 372.68886569 370.31072753 372.56647753 370.11889581 372.58507539\n",
      " 370.11531373 370.03840321 371.0665189  372.10513287 370.25623473\n",
      " 371.64640456 372.13063544 372.80766813 372.56158838 369.07499332\n",
      " 372.2043633  372.90660258 372.11396593 370.57199834 367.66081291\n",
      " 372.32691774 369.43523309 370.75738113 369.57602876 371.08532513\n",
      " 369.14142629 369.56752469 362.23512876 368.51274454 367.09483001\n",
      " 370.38908986 371.09671973 370.81637456 367.97076855 371.2751121\n",
      " 368.60101947 370.83896631 369.68007802 369.42033665 372.92799194\n",
      " 365.47120157 368.71192657 372.68864456 369.80613129 367.28188787\n",
      " 370.80959738 371.40289318 369.51479249 372.35271513 370.3589988\n",
      " 367.20685729 372.13219485 370.04846305 372.33604074 367.35356722\n",
      " 370.81318713 361.34806397 373.03437081 370.94915299 372.71557218\n",
      " 372.01583684 372.82403635 367.20613343 373.04662835 372.57275437\n",
      " 372.41095227 371.79965361 372.31789367 369.85198495 372.91121497\n",
      " 364.23802477 371.64855921 370.72774205 372.59212743 369.02160651\n",
      " 369.06872761 372.82420812 367.65456875 372.58754651 371.5048697\n",
      " 372.68476819 370.27336727 372.11962922 369.63689887 371.73094837\n",
      " 368.43025874 370.08050886 371.42773656 370.03774332 372.11566036\n",
      " 370.36270024 369.63604838 371.67501906 370.3726569  371.41519328\n",
      " 367.50452124 371.66623981 371.31665798 372.582852   372.19273879\n",
      " 370.7099907  360.28333218 371.6116272  369.99040371 370.36945291\n",
      " 370.52985594 369.13648693 372.58566203 369.36956618 370.32178645\n",
      " 372.59674085 370.99545825 372.41608545 369.43523309 366.71921194\n",
      " 369.98991042 372.35953138 372.68304766 370.01854535 372.01907965\n",
      " 372.67749478 370.53512041 369.30296144 371.15939514 369.19788553\n",
      " 370.97678448 369.06346577 372.8157901  368.72422469 373.15241048\n",
      " 370.43943355 370.58677152 371.40336398 371.42201341 370.32885493\n",
      " 372.37061514 370.77916744 370.4618759  369.64967305 366.65250639\n",
      " 369.88717201 371.50080325 369.3999059  369.60793349 368.86966574\n",
      " 372.25606058 371.49734733 371.16713531 371.23837386 363.33216544\n",
      " 369.89847968 372.40205731 369.79425813 368.69013095 371.67541299\n",
      " 372.90534058 371.32925419 372.37610455 370.49910475 373.14863572\n",
      " 367.4282803  370.58385901 371.39363252 372.68785413 372.15546994\n",
      " 371.63703995 371.27448443 372.2022771  372.90660953 373.15608367\n",
      " 372.44182424 372.57693437 373.15192768 370.57043391 371.56465181\n",
      " 371.3863329  369.15639921 370.71295506 372.67580949 372.20569592\n",
      " 372.26722436 368.07196526 371.21337435 370.17383405 371.27549556\n",
      " 372.56344641 371.51904835 368.95589128 370.84912385 371.83498421\n",
      " 371.24917711]\n"
     ]
    }
   ],
   "source": [
    "X3 = pd.DataFrame(scaler.transform(test), columns=test.columns)\n",
    "\n",
    "test2 = X3.copy()\n",
    "\n",
    "lof.fit_predict(X3)\n",
    "\n",
    "lof_scores = -lof.negative_outlier_factor_\n",
    "print(lof_scores)\n",
    "\n",
    "test2['LOF'] = lof_scores\n",
    "\n",
    "isof.fit(X3)\n",
    "\n",
    "isof_scores = -isof.score_samples(X3)\n",
    "print(isof_scores)\n",
    "\n",
    "test2['ISOF'] = isof_scores\n",
    "\n",
    "knn.fit(X3)\n",
    "\n",
    "knn_scores = knn.decision_scores_\n",
    "\n",
    "print(knn_scores)\n",
    "test2['KNN'] = knn_scores\n",
    "\n",
    "svm.fit(X3)\n",
    "svm_scores = svm.score_samples(X3)\n",
    "\n",
    "print(svm_scores)\n",
    "\n",
    "test2['SVM'] = svm_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T15:10:37.906584Z",
     "start_time": "2020-08-30T15:10:37.875269Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature_1</th>\n",
       "      <th>feature_2</th>\n",
       "      <th>feature_3</th>\n",
       "      <th>feature_4</th>\n",
       "      <th>feature_5</th>\n",
       "      <th>feature_6</th>\n",
       "      <th>feature_7</th>\n",
       "      <th>feature_8</th>\n",
       "      <th>feature_9</th>\n",
       "      <th>feature_10</th>\n",
       "      <th>...</th>\n",
       "      <th>feature_1553</th>\n",
       "      <th>feature_1554</th>\n",
       "      <th>feature_1555</th>\n",
       "      <th>feature_1556</th>\n",
       "      <th>feature_1557</th>\n",
       "      <th>feature_1558</th>\n",
       "      <th>LOF</th>\n",
       "      <th>ISOF</th>\n",
       "      <th>KNN</th>\n",
       "      <th>SVM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.092332</td>\n",
       "      <td>0.730829</td>\n",
       "      <td>0.129978</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.776387</td>\n",
       "      <td>0.304796</td>\n",
       "      <td>2.553025</td>\n",
       "      <td>1.523184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.167449</td>\n",
       "      <td>0.278560</td>\n",
       "      <td>0.027599</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.668745</td>\n",
       "      <td>0.309408</td>\n",
       "      <td>3.479320</td>\n",
       "      <td>0.928510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.874931</td>\n",
       "      <td>0.309267</td>\n",
       "      <td>2.859316</td>\n",
       "      <td>0.990095</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.092332</td>\n",
       "      <td>0.730829</td>\n",
       "      <td>0.129978</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.606684</td>\n",
       "      <td>0.316816</td>\n",
       "      <td>3.676675</td>\n",
       "      <td>-0.150049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.092332</td>\n",
       "      <td>0.186228</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.106920</td>\n",
       "      <td>0.334473</td>\n",
       "      <td>5.002871</td>\n",
       "      <td>-2.606926</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>751</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.886372</td>\n",
       "      <td>0.309733</td>\n",
       "      <td>2.864398</td>\n",
       "      <td>0.991237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>752</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033309</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.744111</td>\n",
       "      <td>0.330774</td>\n",
       "      <td>4.472136</td>\n",
       "      <td>-1.571920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>753</th>\n",
       "      <td>0.017214</td>\n",
       "      <td>0.156495</td>\n",
       "      <td>0.140255</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.640448</td>\n",
       "      <td>0.314316</td>\n",
       "      <td>3.875982</td>\n",
       "      <td>0.321312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>754</th>\n",
       "      <td>0.046948</td>\n",
       "      <td>0.136150</td>\n",
       "      <td>0.047288</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.027964</td>\n",
       "      <td>0.308017</td>\n",
       "      <td>2.832126</td>\n",
       "      <td>1.307173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>755</th>\n",
       "      <td>0.075117</td>\n",
       "      <td>0.134585</td>\n",
       "      <td>0.029567</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.107300</td>\n",
       "      <td>0.312583</td>\n",
       "      <td>3.317236</td>\n",
       "      <td>0.721365</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>756 rows × 1562 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     feature_1  feature_2  feature_3  feature_4  feature_5  feature_6  \\\n",
       "0     0.092332   0.730829   0.129978        1.0        0.0        0.0   \n",
       "1     0.167449   0.278560   0.027599        1.0        0.0        0.0   \n",
       "2     0.000000   0.000000   0.033309        0.0        0.0        0.0   \n",
       "3     0.092332   0.730829   0.129978        1.0        0.0        0.0   \n",
       "4     0.092332   0.186228   0.033309        1.0        0.0        0.0   \n",
       "..         ...        ...        ...        ...        ...        ...   \n",
       "751   0.000000   0.000000   0.033309        0.0        0.0        0.0   \n",
       "752   0.000000   0.000000   0.033309        0.0        0.0        0.0   \n",
       "753   0.017214   0.156495   0.140255        1.0        0.0        0.0   \n",
       "754   0.046948   0.136150   0.047288        1.0        0.0        0.0   \n",
       "755   0.075117   0.134585   0.029567        0.0        0.0        0.0   \n",
       "\n",
       "     feature_7  feature_8  feature_9  feature_10  ...  feature_1553  \\\n",
       "0          0.0        0.0        0.0         0.0  ...           0.0   \n",
       "1          0.0        0.0        0.0         0.0  ...           0.0   \n",
       "2          0.0        0.0        0.0         0.0  ...           0.0   \n",
       "3          0.0        0.0        0.0         0.0  ...           0.0   \n",
       "4          0.0        0.0        0.0         0.0  ...           0.0   \n",
       "..         ...        ...        ...         ...  ...           ...   \n",
       "751        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "752        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "753        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "754        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "755        0.0        0.0        0.0         0.0  ...           0.0   \n",
       "\n",
       "     feature_1554  feature_1555  feature_1556  feature_1557  feature_1558  \\\n",
       "0             0.0           0.0           0.0           0.0           0.0   \n",
       "1             0.0           0.0           0.0           0.0           0.0   \n",
       "2             0.0           0.0           0.0           0.0           0.0   \n",
       "3             0.0           0.0           0.0           0.0           0.0   \n",
       "4             0.0           0.0           0.0           0.0           0.0   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "751           0.0           0.0           0.0           0.0           0.0   \n",
       "752           0.0           0.0           0.0           0.0           0.0   \n",
       "753           0.0           0.0           0.0           0.0           0.0   \n",
       "754           0.0           0.0           0.0           0.0           0.0   \n",
       "755           0.0           0.0           0.0           0.0           0.0   \n",
       "\n",
       "          LOF      ISOF       KNN       SVM  \n",
       "0    1.776387  0.304796  2.553025  1.523184  \n",
       "1    1.668745  0.309408  3.479320  0.928510  \n",
       "2    1.874931  0.309267  2.859316  0.990095  \n",
       "3    2.606684  0.316816  3.676675 -0.150049  \n",
       "4    3.106920  0.334473  5.002871 -2.606926  \n",
       "..        ...       ...       ...       ...  \n",
       "751  1.886372  0.309733  2.864398  0.991237  \n",
       "752  2.744111  0.330774  4.472136 -1.571920  \n",
       "753  1.640448  0.314316  3.875982  0.321312  \n",
       "754  2.027964  0.308017  2.832126  1.307173  \n",
       "755  2.107300  0.312583  3.317236  0.721365  \n",
       "\n",
       "[756 rows x 1562 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test2['SVM'] = test2['SVM'] - test2['SVM'].mean()\n",
    "\n",
    "display(test2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-30T15:11:11.404931Z",
     "start_time": "2020-08-30T15:11:10.468890Z"
    }
   },
   "outputs": [],
   "source": [
    "test2.to_csv('./data/MH18_Test2.csv', index=False)"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": true,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
